package com.gr.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gr.entity.Record;
import com.gr.entity.Student;
import com.gr.service.IRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author guoran
 * @since 2022-05-01
 */
@RestController
@RequestMapping("/record")
public class RecordController {
    @Autowired
    private IRecordService irs;
    @GetMapping("/selectByStuId/{stuId}")
    public List<Record> selectByStuId(@PathVariable("stuId") int stuId){
        return irs.selectByStuId(stuId);
    }

    @GetMapping("/selectByPage")
    public IPage<Record> selectByPage(Page page){
        return irs.page(page);
    }
}

